export function createElement(type, props, ...children) {
    const childrenNodes = [...children].reduce((res, child) => {
        if (child === null || child === false || child === null) {
            return
        }
       
        if ( child instanceof Object) {
            res.push(child)
        } else {
             res.push(createElement('text', {
                textContent: child
            }))
        }
        return res
    }, [])
    return {
        type,
        props: {
            ...props,
            children: childrenNodes
        }
    }
}